<template>
  <div class="bos">
    <head-page
      :title="`${this.$route.query.name}`"
      style="border-bottom: none"
      id="backstyle"
    >
    </head-page>
    <Banner id="9" class="bannerId"></Banner>
    <!-- 标题区域 -->
    <div class="title title-center l-h tac">{{ index }}.&nbsp;{{ title }}</div>
    <!-- 整体区域 -->
    <div class="boss">
      <div class="area-center title-center">
        <!-- 头部内容区域 -->
        <div class="top">
          <!-- 盒子区域 -->
          <div
            :class="['smallhe m-t-07', curr == index ? 'active' : '']"
            v-for="(item, index) in nationwide"
            :key="index"
          >
            <div class="left">
              <div class="yuan"></div>
            </div>
            <div class="right" @click="getDetail(item, index)">
              {{ item.name }}
            </div>
          </div>
        </div>
        <!-- <h2>请选择省份</h2> -->
        <!-- 各省的总区域 -->
        <!-- <div class="cap">
					<div
						class="hezi"
						v-for="(item, index) in address"
						:key="index"
					>
						{{ item.provincial }}
					</div>
				</div> -->
      </div>
    </div>
    <!-- 整体区域 -->
    <div class="area-center title-center">
      <div class="xiao m-t-07" v-for="(item, index) in subList" :key="index">
        <div class="left">
          <!-- <img src="../../../assets/black_star.png" alt="" /> -->
          {{ index + 1 }}.
        </div>
        <div class="zhong richText" v-html="item.organizationName"></div>
      </div>
    </div>
  </div>
</template>

<script>
import Banner from "@/components/Home/BannerView.vue";
import { rganizationTypeId, selectAllTitle, selectTitle } from "@/api/index";
export default {
  data() {
    return {
      list: [],
      subList: [],
      title: "",
      address: [],
      index: this.$route.query.i,
      citytitle: sessionStorage.getItem("province"),
      citysub: sessionStorage.getItem("provincesub"),
      ID: this.$route.query.id,
      nationwide: [
        {
          name: sessionStorage.getItem("province") + "内企业",
        },
        {
          name: "全国各省企业",
        },
      ],
      curr: 0,
      detailList: [],
    };
  },
  components: {
    Banner,
  },
  mounted() {
    //驻会机构查询
    rganizationTypeId(this.$route.query.id).then((res) => {
      if (res.data.code == 200) {
        this.title = res.data.data.organizationTypeName;
        this.list = res.data.data.organizationTypes;
      }
    });
    this.getDetail("", "0");
  },
  methods: {
    getDetail(item, i) {
      this.curr = i;
      let request = "",
        params = {
          organizationtypeId: this.$route.query.id,
        };
      if (i == "0") {
        request = selectTitle;
        params.organizationProvincial = sessionStorage.getItem("provincesub");
      } else {
        request = selectAllTitle;
      }
      request(params).then((res) => {
        if (res.data.code == 200) {
          this.subList = res.data.data;
        }
      });
    },
  },
};
</script>

<style scoped>
.bos {
  width: 100%;

}
/* 标题区域 */
.title {
  width: 100%;

}

/* 整体区域 */
.boss {
  width: 100%;
  display: flex;
  justify-content: center;
}
/* 版心区域 */
.center {
  width: 95%;
}
/* 头部内容区域 */
.top {
  width: 100%;
}

/* 盒子区域 */
.smallhe {
  width: 100%;
  display: flex;
}
.left {
  height: 100%;
  font-weight: 700;
  font-size: 18px;
}
.yuan {
  width: 0.18rem;
  height: 0.18rem;
  border-radius: 50%;
  border: 1px solid;
  /* background-color: black; */
  margin-top: 0.08rem;
}
.right {
  width: 95%;
  height: 100%;
  line-height: 0.35rem;
  padding-left: 0.05rem;
}
h2 {
  text-align: center;
}
/* 各省的总区域 */
.cap {
  display: flex;
  flex-wrap: wrap;
  margin-top: 0.05rem;
}
.hezi {
  min-width: 0.5rem;
  height: 0.3rem;
  flex-shrink: 0;
  text-align: center;
  line-height: 0.3rem;
  font-weight: 700;
  margin: 4px;
}
.smallhe.active {
  color: red;
}
.xiao {
  width: 100%;
  display: flex;
  align-items: center;
}
/* 左边区域 */
.xiao .left {
  width: 5%;
  height: 100%;
  margin-left: 0.1rem;
}
.xiao .left img {
  width: 0.2rem;
  height: 0.2rem;
  margin-top: 0.03rem;
}
.xiao .num {
  width: 5%;
  height: 0.3rem;
  margin-left: 0.1rem;
  font-weight: 700;
  text-align: center;
  line-height: 0.3rem;
}

/* 中间区域 */
.zhong {
  width: 95%;
  height: 100%;
  line-height: 0.3rem;
  padding-left: 0.05rem;
}
</style>